package jobs;

import java.text.SimpleDateFormat;

import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;

import play.jobs.Job;
import play.jobs.On;
import play.libs.Mail;
import util.EmailHelper;

@On("0 25 09 * * ? ")
public class SendMenuMailJob extends Job {

	static SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd");

	@Override
	public void doJob() throws EmailException {

		Email email = EmailHelper.buildMenuEmail();
		if (email != null) {
			Mail.send(email);
		}
	}
}
